import { http } from "@/utils/http/axios";
/**
 * 获取职位分页列表
 * @returns
 */
export function getPageList(params = {}) {
	return http.request<API.Response.BasicResponse>(
		{
			url: "system/post/page",
			method: "get",
			params
		},
		{
			isTransformResponse: false
		}
	);
}
/**
 * 根据ID查询
 * @param id
 * @returns
 */
export function getPosition(id: number | undefined) {
	return http.request(
		{
			url: "system/post/" + id,
			method: "get"
		},
		{
			isTransformResponse: true
		}
	);
}
/**
 * 新增职位
 * @param 新增职位参数
 * @returns
 */
export function save(params: any) {
	return http.request({
		url: "/system/post",
		method: "POST",
		data: params
	});
}
/**
 * 修改职位
 * @param 修改职位参数
 * @returns
 */
export function update(params: any) {
	return http.request(
		{
			url: "/system/post",
			method: "PUT",
			data: params
		},
		{
			isTransformResponse: false
		}
	);
}
/**
 * 删除职位
 * @param ids 职位ID
 * @returns
 */
export function remove(id: number | Array<number>) {
	return http.request(
		{
			url: "/system/post/" + id,
			method: "DELETE"
		},
		{
			isTransformResponse: false
		}
	);
}
// 岗位下拉框
export function optionSelecet() {
	return http.request(
		{
			url: "system/post/optionselect",
			method: "GET"
		},
		{
			isTransformResponse: true
		}
	);
}
